﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameModeState
{
    private EGameMode m_GameMode = EGameMode.None;
    private GameModeInLobby m_GameModeInLobby = new GameModeInLobby();
    private GameModeInGame m_GameModeInGame = new GameModeInGame();

    public void ChangeGameModeState(EGameMode mode)
    {
       
        switch(mode)
        {
            case EGameMode.InLobby:
                {
                    m_GameModeInLobby.Enter();
                    if (m_GameMode == EGameMode.InGame)
                    {
                        m_GameModeInGame.Leave();
                    }
                    break;
                }
            case EGameMode.InGame:
                {
                    m_GameModeInGame.Enter();
                    if(m_GameMode== EGameMode.InLobby)
                    {
                        m_GameModeInLobby.Leave();
                    }
                    break;
                }
        }
        m_GameMode = mode;
    }
}
